'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 升级士兵
 * @author sundbcn@gmail.com (sun debing)
 */

var soldierUpgrade = require('./soldier/upgrade');
var soldierSelect = require('./soldier/select');
var soldierUpgradeStar = require('./soldier/upgradeStar.js');
var soldierUpgradeTalent = require('./soldier/upgradeTalent.js');
var soldierCompose = require('./soldier/compose.js');
var oneKeyUpgrade = require('./soldier/oneKeyUpgrade.js');
var getBattleSoldierSpaceCount = require('./soldier/getBattleSoldierSpaceCount.js');

module.exports = function (app) {
    return new Handler(app);
};

var Handler = function (app) {
    this.app = app;
};

/**
 * 一键升级士兵
 */
Handler.prototype.oneKeyUpgrade = function (msg, session, next) {
    oneKeyUpgrade(msg, session, next);
};

/**
 * 升级士兵
 */
Handler.prototype.upgrade = function (msg, session, next) {
    soldierUpgrade(msg, session, next);
};

/**
 * 修改战斗时候选择的兵种
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.select = function (msg, session, next) {
    soldierSelect(msg, session, next);
};

/**
 * 土兵升星
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.upgradeStar = function (msg, session, next) {
    soldierUpgradeStar(msg, session, next);
};

/**
 * 升级天赋
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.upgradeTalent = function (msg, session, next) {
    soldierUpgradeTalent(msg, session, next);
};

/**
 * 合成士兵
 * @param  {[type]}   msg     [description]
 * @param  {[type]}   session [description]
 * @param  {Function} next    [description]
 * @return {[type]}           [description]
 */
Handler.prototype.compose = function (msg, session, next) {
    soldierCompose(msg, session, next);
};

/**
 * 查询开启出阵士兵格式数
 */
Handler.prototype.getBattleSoldierSpaceCount = function (msg, session, next) {
    getBattleSoldierSpaceCount(msg, session, next);
};
